/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.i.kotionokyurievna.jewelryweb.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ejb.Stateless;
import javax.persistence.TypedQuery;
import ua.i.kotionokyurievna.jewelryweb.entities.User;

/**
 *
 * @author Kateryna_Reznik
 */
@Stateless
public class UserDAO extends GenericDAO<User> {

    public UserDAO(){
        super(User.class);
    }
    
    public void saveUser( User user ){
        super.save(user);
    }
    
    public User findUserByLogin(String login){
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("login", login);     
 
        return (User)super.findOneResult( User.FIND_BY_LOGIN, parameters);
    }
    
    
    
}
